<%@page import="java.util.List"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.situ.web.entity.Student"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<!-- EL表达式最主要作用：从域对象中取出数据 -->
	<%
		// 1.普通票字符串
		pageContext.setAttribute("name", "zhangsan");
		request.setAttribute("name", "lisi");
		// 2.Student对象
		Student student = new Student(1, "王五", 23, "男");
		session.setAttribute("student", student);
		// 3.List<Student>
		List<Student> list = new ArrayList<Student>();
		Student student1 = new Student(1, "赵六1", 23, "男");
		Student student2 = new Student(1, "赵六2", 23, "男");
		Student student3 = new Student(1, "赵六3", 23, "男");
		list.add(student1);
		list.add(student2);
		list.add(student3);
		application.setAttribute("list", list);
	%>
	
	<!-- 1.获取普通字符串 -->
	<!-- 使用JSP表达式 -->
	<%=pageContext.getAttribute("name") %><br/>
	<%=request.getAttribute("name") %><br/>
	<%=pageContext.findAttribute("name") %>
	<!-- 使用EL表达式 -->
	${pageScope.name}<br/>
	${requestScope.name}<br/>
	${name}<br/>
	<hr/>
	
	<!-- 2.Student对象 -->
	<!-- 使用JSP表达式 -->
	<%
		Student stu = (Student)session.getAttribute("student");
	%>
	<%=stu.getName()%>
	<%=stu.getAge()%><br/>
	<!-- 使用EL表达式 -->
	${sessionScope.student.name}
	${student.age}
	
	<hr/>
	
	
	<!-- 3.List<Student> -->
	<!-- 使用JSP表达式 -->
	<%
		List<Student> stuList = (List<Student>)application.getAttribute("list");
	%>
	<%=stuList.get(1).getName()%><br/>
	<!-- 使用EL表达式 -->
	${applicationScope.list[1].name}
	${list[1].age}
	
</body>
</html>